package com.cisystem.system.service.impl;

import java.util.List;
import com.cisystem.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cisystem.system.mapper.SysMailAccountMapper;
import com.cisystem.system.domain.SysMailAccount;
import com.cisystem.system.service.ISysMailAccountService;

/**
 * 邮箱账号Service业务层处理
 *
 * @author ruoyi
 * @date 2023-10-24
 */
@Service
public class SysMailAccountServiceImpl implements ISysMailAccountService
{
    @Autowired
    private SysMailAccountMapper sysMailAccountMapper;

    /**
     * 查询邮箱账号
     *
     * @param id 邮箱账号主键
     * @return 邮箱账号
     */
    @Override
    public SysMailAccount selectSysMailAccountById(Long id)
    {
        return sysMailAccountMapper.selectSysMailAccountById(id);
    }

    /**
     * 查询邮箱账号列表
     *
     * @param sysMailAccount 邮箱账号
     * @return 邮箱账号
     */
    @Override
    public List<SysMailAccount> selectSysMailAccountList(SysMailAccount sysMailAccount)
    {
        return sysMailAccountMapper.selectSysMailAccountList(sysMailAccount);
    }

    /**
     * 新增邮箱账号
     *
     * @param sysMailAccount 邮箱账号
     * @return 结果
     */
    @Override
    public int insertSysMailAccount(SysMailAccount sysMailAccount)
    {
        sysMailAccount.setCreateTime(DateUtils.getNowDate());
        return sysMailAccountMapper.insertSysMailAccount(sysMailAccount);
    }

    /**
     * 修改邮箱账号
     *
     * @param sysMailAccount 邮箱账号
     * @return 结果
     */
    @Override
    public int updateSysMailAccount(SysMailAccount sysMailAccount)
    {
        sysMailAccount.setUpdateTime(DateUtils.getNowDate());
        return sysMailAccountMapper.updateSysMailAccount(sysMailAccount);
    }

    /**
     * 批量删除邮箱账号
     *
     * @param ids 需要删除的邮箱账号主键
     * @return 结果
     */
    @Override
    public int deleteSysMailAccountByIds(Long[] ids)
    {
        return sysMailAccountMapper.deleteSysMailAccountByIds(ids);
    }

    /**
     * 删除邮箱账号信息
     *
     * @param id 邮箱账号主键
     * @return 结果
     */
    @Override
    public int deleteSysMailAccountById(Long id)
    {
        return sysMailAccountMapper.deleteSysMailAccountById(id);
    }
}
